package homework.chapter12;

import java.util.Arrays;

public class TestEmployee {
    public static void main(String[] args) {
        Employee[] employees = {
                new Employee("蒋敦豪",9000,29),
                new Employee("鹭卓",8000,29),
                new Employee("李耕耘",7000,28),
                new Employee("李昊",6000,27),
        };

//        Arrays.sort(employees);
//        for (Employee employee : employees) {
//            System.out.println("employee = " + employee);
//        }

        Arrays.sort(employees,new EmployeeAgeComparator());
        System.out.println("Sorted by age and name:");
        for (Employee employee : employees) {
            System.out.println("employee = " + employee);
        }
    }
}
